package com.pro01.springlearning.service.impl;

import com.pro01.springlearning.mapper.UserMapper;
import com.pro01.springlearning.pojo.User;
import com.pro01.springlearning.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public boolean register(User user) {
        return userMapper.insertUser(user) > 0;
    }

    @Override
    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }
}
